package nc.ui.ta.monthdetail.model;

import nc.ui.hr.uif2.model.HRMetaDataDataSource;
import nc.ui.uif2.model.BatchBillTableModel;
import nc.ui.uif2.model.BillManageModel;

public class MonthDetailMetaDataDataSource extends HRMetaDataDataSource {

	private static final long serialVersionUID = -3463606217093991284L;

	@Override
	public Object[] getMDObjects() {

	    if (getModel() == null)
	    {
	        return null;
	    }
	    if (getModel() instanceof BillManageModel)
	    {
	        return ((BillManageModel) getModel()).getData().toArray();
	    }
	    else if (getModel() instanceof BatchBillTableModel)
	    {
	        return ((BatchBillTableModel) getModel()).getRows().toArray();
	    }
	    
	    return new Object[]{getModel().getSelectedData()};
	}
}
